Skip to content

Feature/Fix: Discover referenced long-lived Codex parents#2142

Closed
iam-brain wants to merge 3 commits into
steipete:mainfrom
iam-brain:iam-brain/bounded-lineage-discovery
Closed

Feature/Fix: Discover referenced long-lived Codex parents#2142
iam-brain wants to merge 3 commits into
steipete:mainfrom
iam-brain:iam-brain/bounded-lineage-discovery

Conversation

@iam-brain

@iam-brain iam-brain commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Stack dependency

This is slice 3 of 15. It follows Feature/Fix: Adapt rollout snapshots for lineage accounting; review and merge that PR first.

Summary

  • expand a bounded rollout selection only when an included document references a missing ancestor
  • resolve transitive parents across active and archived rollout roots without admitting unrelated old documents
  • report unresolved parent identities and canonicalize UUID casing

This is the third isolated component of the planned Codex scanner rearchitecture. It keeps the normal discovery window bounded while making exceptional long-lived lineages traceable.

Validation

  • swift test --filter CodexLineageDiscoveryTests (3 tests)
  • make check
  • env SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.5.sdk make test (640 selections; one group recovered on retry)
  • repository review gate: no unresolved material findings

Related investigation: steipete/CodexBar#2037.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. labels Jul 14, 2026
@clawsweeper

clawsweeper Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed July 13, 2026, 9:16 PM ET / July 14, 2026, 01:16 UTC.

Summary
Adds a shadow lineage ledger and parser adapter, then expands bounded Codex rollout discovery transitively to referenced parents across active and archived roots.

Reproducibility: yes. at source level: the canonical investigation and sanitized fixtures establish that bounded scans can omit referenced long-lived ancestors. This review did not execute a current-main live reproduction.

Review metrics: 3 noteworthy metrics.

  • Stack position: slice 3 of 15. The branch depends on an open predecessor and is itself required by the next open accounting slice.
  • Patch surface: 6 files, +729/-5. The visible diff includes inherited ledger and parser-adapter foundations as well as this slice's discovery implementation.
  • Focused discovery tests: 3 tests reported. The cases exercise the main synthetic discovery boundaries, but they are not real-behavior proof.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #2037
Summary: This PR is an implementation slice for the canonical Codex overcount issue's remaining cross-window lineage closure; the adjacent PRs are dependent stack slices rather than replacements.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted terminal output showing an old transitive parent is discovered across active/archive roots while unrelated historical rollouts remain excluded.
  • Refresh the branch after the preceding stack slices land so maintainers can review the exact standalone diff.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR reports tests and checks but no after-fix live run against a real Codex rollout tree; add redacted terminal or live output, then update the PR body to trigger review or ask a maintainer to comment @clawsweeper re-review.

Risk before merge

  • [P1] The branch is stacked on an unmerged predecessor, so reviewers cannot yet validate the final standalone merge diff or interaction with the landed version of that dependency.
  • [P1] Synthetic tests do not establish how discovery performs against a real, potentially large rollout archive or confirm that only referenced historical files are admitted in practice.

Maintainer options:

  1. Decide the mitigation before merge
    Land the lineage architecture in dependency order while preserving bounded discovery, cancellation, cache correctness, unrelated-history exclusion, and fail-open production accounting, with redacted real-rollout evidence before activation.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Review the draft after its predecessor lands and require contributor-supplied real-rollout proof; there is no narrow automated code repair identified.

Security
Cleared: The Swift source and test changes add no dependency, workflow, permission, secret-handling, package-resolution, or downloaded-code surface.

Review details

Best possible solution:

Land the lineage architecture in dependency order while preserving bounded discovery, cancellation, cache correctness, unrelated-history exclusion, and fail-open production accounting, with redacted real-rollout evidence before activation.

Do we have a high-confidence way to reproduce the issue?

Yes at source level: the canonical investigation and sanitized fixtures establish that bounded scans can omit referenced long-lived ancestors. This review did not execute a current-main live reproduction.

Is this the best way to solve the issue?

Likely yes: following only referenced ancestors is narrower and safer than widening the normal discovery window, although the stacked integration and real-archive behavior still require proof.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 0437067deaa8.

Label changes

Label changes:

  • add P2: This is a normal-priority fix component for incorrect Codex accounting with limited immediate blast radius because the ledger does not yet participate in production totals.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR reports tests and checks but no after-fix live run against a real Codex rollout tree; add redacted terminal or live output, then update the PR body to trigger review or ask a maintainer to comment @clawsweeper re-review.

Label justifications:

  • P2: This is a normal-priority fix component for incorrect Codex accounting with limited immediate blast radius because the ledger does not yet participate in production totals.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR reports tests and checks but no after-fix live run against a real Codex rollout tree; add redacted terminal or live output, then update the PR body to trigger review or ask a maintainer to comment @clawsweeper re-review.
Evidence reviewed

What I checked:

  • Unique remaining work: The canonical investigation remains open because the merged containment fix did not implement complete cross-file lineage closure; this PR addresses the missing ancestor-discovery portion. (Sources/CodexBarCore/Vendored/CostUsage/CostUsageScanner.swift:1687, 0437067deaa8)
  • Bounded ancestor discovery: The new resolver starts from already-included rollout files, follows referenced parents transitively, searches active and archived roots, canonicalizes identifiers, and records unresolved parents without admitting unrelated old documents. (Sources/CodexBarCore/Providers/Codex/CodexLineageDiscovery.swift:1, 5c2b75e5871a)
  • Focused regression coverage: New tests cover transitive discovery across active/archive roots, exclusion of unrelated archived rollouts, unresolved identities, UUID casing, and cancellation behavior. (Tests/CodexBarTests/CodexLineageDiscoveryTests.swift:1, 5c2b75e5871a)
  • Stack dependency: The PR declares itself slice 3 of 15 and depends on the still-open parser-adapter PR; the following accounting-dimensions PR depends on this branch. (5c2b75e5871a)
  • Validation is test-only: The PR body reports focused tests, repository checks, and the full suite, but includes no redacted live scanner output or other after-fix evidence from a real Codex rollout tree. (5c2b75e5871a)

Likely related people:

  • steipete: Reviewed and validated the merged containment work for the canonical Codex overcount investigation and is closely connected to the accepted accounting boundary. (role: recent reviewer and adjacent area contributor; confidence: high; commits: 7465c6a11674; files: Sources/CodexBarCore/Vendored/CostUsage/CostUsageScanner.swift, Tests/CodexBarTests/Issue2037ScannerIntegrationTests.swift)
  • Zihao-Qi: Authored the merged containment and provenance-fixture work that established the remaining cross-file lineage requirements. (role: recent feature contributor; confidence: high; commits: 7465c6a11674; files: Sources/CodexBarCore/Vendored/CostUsage/CostUsageScanner.swift, Tests/CodexBarTests/Issue2037ScannerIntegrationTests.swift)
  • xx205: Authored earlier fork baseline and replay-accounting behavior in the scanner path that the lineage-ledger work extends. (role: introduced adjacent accounting behavior; confidence: medium; commits: 45b68c34ec48; files: Sources/CodexBarCore/Vendored/CostUsage/CostUsageScanner.swift, Tests/CodexBarTests/CostUsageScannerBreakdownTests.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@iam-brain

Copy link
Copy Markdown
Contributor Author

Superseded by the consolidated four-PR review stack. This slice is now included in #2156; closing this draft to keep the upstream review surface manageable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant